package com.alks.function.mapper.stockdept.pcfactorystockquery;

import com.alks.entity.data.entity.PcLotUsage;
import com.alks.entity.data.entity.PcSlipTemp;
import com.alks.function.data.dto.stockdept.pcfactorystockwork.LotMtlDto;
import com.alks.function.data.dto.stockdept.pcfactorystockwork.SpPartDto;
import com.alks.function.data.request.stockdept.pcfactorystockwork.LotMtlRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.OMtlwaitAddRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.SpPartRequest;
import com.alks.function.data.vo.controller.stockdept.UsageToSuppVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ms
 * @since 2023-09-08
 */
@Mapper
public interface SD_SQ_PcLotUsageMapper extends BaseMapper<PcLotUsage> {


    /*查询指令材料*/
    List<LotMtlDto> getLotMtlQuery(@Param("request") LotMtlRequest request, @Param("slipType") int slipType);

    /*新增用指令资料查询*/
    PcSlipTemp lotMtlQuery(@Param("lotNo") String lotNo, @Param("seqNo") Integer seqNo);

    /*待入库新增查询*/
    List<PcSlipTemp> getOtMtlWaitStk2(@Param("request") List<OMtlwaitAddRequest> request);

    /*剩料用指令材料查询*/
    List<LotMtlDto> getLotMtlQuery1(@Param("request") LotMtlRequest request, @Param("slipType") int slipType);

    /**
     * 根据LOT_NO和MTL_NO组成的MAP查询数量
     * @param lotMtls
     * @param companyId
     * @return
     */
    List<Map<String, Object>> getQtyByMap(@Param("lotMtls") Map<String, String> lotMtls, @Param("companyId") String companyId);

    List<UsageToSuppVo> getPartAddQuery(@Param("request") SpPartRequest request, @Param("companyId") String companyId);

    /**
     * 指令用量查询
     */
    List<SpPartDto> getSpPartQuery(@Param("lotNo") String lotNo);
}
